Understanding Query Definitions for Effectivity Resolution

This section provides an overview of the Query Definitions (QD) configuration for resolving the BOM structures against Effectivity Criteria.

  1. Definition of a QD containing Effectivity filtering logic.

  2. Merging this QD into another QD to create a single executable QD for a related Tree Grid View.

You can configure the PE_BomStructure TGV to add, remove, or reorder columns to display Part and Part BOM properties. Adding or removing columns requires changing the QD configuration to return the given properties. You can use the standard TGV and QD procedures for this configuration.

The QD containing Effectivity filtering logic is effs_effectivityResolutionOnPartBom. It retrieves assigned Effectivity Expressions and evaluates them against the given Effectivity Criteria in the Resolution Engine. The QD filters out Items that are evaluated as not valid for the given Effectivity Criteria.

Figure 27.

The effs_effectivityResolutionOnPartBom QD passes data to the Effectivity Resolution Engine using the following Query Parameters:

  • EffectivityScopeId—the ID of the Effectivity Scope.

  • EffectivityCriteriaDefinition—the Effectivity Criteria Definition.

The Query Structure of the effs_effectivityResolutionOnPartBom QD is as follows:

  • Part BOM is the Effective ItemType of the PE application Effectivity Scopes.

Where Condition:

(Count(effs_Part_BOM_expr_no_resolve) = 0)

OR

(Count(effs_Part_BOM_expression) > 0)

Note: You can change the Where Condition to use AND logic instead of OR. The logic to use depends on how multiple Effectivity Expressions on a given single Part BOM Item should be evaluated. For details, refer to section Configuring Logic to Evaluate Effectivity Expressions for Effectivity Resolution.

Figure 28.

Note: It is recommended to use only the “Count()” aggregate function for Effectivity relationships to prevent performance degradation.

  • effs_Part_BOM_expression is a RelationshipType with the source Part BOM ItemType.

Where Condition:

(Scope = $EffectivityScopeId) AND (Definition = '<expression>$EffectivityCriteriaDefinition</expression>')

The Effectivity Scope ID value is set from the Scope cell, and the Effectivity Criteria Definition value is set from the Variables and Values cells of the Effectivity Criteria Filter dialog.

Join Condition:

[Part BOM].id = effs_Part_BOM_expression.source_id

Figure 29.

  • effs_Part_BOM_expr_no_resolve is used to check if the Part BOM item has any effectivity relationship items for the specified scope.

Where Condition:

Scope = $EffectivityScopeId

The Effectivity Scope ID value is set from the Scope cell.

Join Condition:

[Part BOM].id = effs_Part_BOM_expr_no_resolve.source_id

Figure 30.

The effs_effectivityResolutionOnPartBom QD is merged into the PE_BomStructure QD to produce a single executable QD, as described later in this section.

Graphical user interface, text, application, email

Description automatically generated

Figure 31.

The PE_BomStructure QD has the following Query Parameters:

  • EffectivityResolutionMode — structure resolution mode. Aras.Resolution.EntryPoint;Default is the default value.

  • EffectivityResolutionConfigurationQueryDefinitionId — ID of the QD containing Effectivity filtering logic to enable Effectivity resolution.

  • EffectivityScopeId — ID of the Effectivity Scope Item passed to the Effectivity Resolution Engine.

  • EffectivityCriteriaDefinition — the Effectivity Criteria Definition passed to the Effectivity Resolution Engine.

When Effectivity Resolution is triggered from the Effectivity Criteria Filter dialog (see section Understanding TGV Definition for Effectivity Resolution), the EffectivityResolutionConfigurationQueryDefinitionId parameter value is retrieved from the effs_getResolutionCfgQdIdByTgvId Method.

Figure 32.

The method defines 1-to-1 associations between Tree Grid Views and Query Definitions containing Effectivity Resolution logic to be merged for Effectivity Resolution, when triggered from the Effectivity Criteria Filter dialog.

The Query structure of the PE_BomStructure QD is recursive:

  • Part BOM is the root ItemType of the BOM Structure accordion tab.

    Order:

1. Sequence (Ascending)

Where Condition:

$EffectivityResolutionConfigurationQueryDefinitionId =

$EffectivityResolutionConfigurationQueryDefinitionId

Note: This condition is used as an anchor to detect the place in the QD where the effectivityResolutionOnPartBom QD is merged. This condition should not be removed otherwise Effectivity Resolution will not work.

Properties:

Quantity, Sequence, Reference Designator, Expression, id

Figure 33.

  • Part

    Join Condition:

    '$StructureResolutionMode;parent.related_id' = Part.id

    Properties:

    Part Number, Revision, State, locked_by_id, Name, id

Figure 34.

  • Part BOM is extracted recursively – all its values are the same as for the top Part BOM, and the following Join Condition is added:

    Part.id = [Part BOM].source_id

Figure 35.

To merge the QD for Effectivity Resolution, the PE_BomStructure QD has the OnBeforeExecute event set for the effs_mergeQueryDefinition Method.

Figure 36.

By default, the QD Item view does not display tabs. To view and to add events to QDs, make tabs visible by setting the Default Structure View property of the qry_QueryDefinition ItemType to Tabs On.

Figure 37.